// 默认图片配置
const DEFAULT_IMAGES = {
  cover: '/assets/default-cover.svg',
  playlists: {
    hot: '/assets/playlist-hot.svg',
    new: '/assets/playlist-new.svg',
    classic: '/assets/playlist-classic.svg',
    pop: '/assets/playlist-pop.svg',
    kpop: '/assets/playlist-kpop.svg',
    movie: '/assets/playlist-movie.svg'
  },
  banners: {
    festival: '/assets/banner-festival.svg',
    newmusic: '/assets/banner-newmusic.svg'
  }
}

// 获取歌单封面图
function getPlaylistCover(id) {
  const types = ['hot', 'new', 'classic', 'pop', 'kpop', 'movie']
  return DEFAULT_IMAGES.playlists[types[(id - 1) % types.length]] || DEFAULT_IMAGES.cover
}

// 获取轮播图
function getBannerImage(id) {
  const types = ['festival', 'newmusic']
  return DEFAULT_IMAGES.banners[types[(id - 1) % types.length]] || DEFAULT_IMAGES.cover
}

// 歌单歌曲数据
const PLAYLIST_SONGS = {
  1: [ // 热门推荐
    { id: 1, name: '稻香', artist: '周杰伦', duration: '3:43', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185008.mp3' },
    { id: 2, name: '青花瓷', artist: '周杰伦', duration: '3:58', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185009.mp3' },
    { id: 3, name: '夜曲', artist: '周杰伦', duration: '3:41', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185010.mp3' },
    { id: 4, name: '七里香', artist: '周杰伦', duration: '4:12', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185011.mp3' },
    { id: 5, name: '告白气球', artist: '周杰伦', duration: '3:34', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185012.mp3' },
    { id: 6, name: '晴天', artist: '周杰伦', duration: '4:29', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185013.mp3' },
    { id: 7, name: '简单爱', artist: '周杰伦', duration: '4:24', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185014.mp3' },
    { id: 8, name: '听妈妈的话', artist: '周杰伦', duration: '4:22', picUrl: '/assets/default-cover.svg', url: 'https://music.163.com/song/media/outer/url?id=185015.mp3' }
  ],
  2: [ // 新歌首发
    { id: 201, name: '孤勇者', artist: '陈奕迅', duration: '4:16', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 202, name: '星辰大海', artist: '黄霄云', duration: '3:52', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 203, name: '四季予你', artist: '程响', duration: '4:08', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 204, name: '删了吧', artist: '黄静美', duration: '3:45', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 205, name: '热爱105°C的你', artist: '阿肆', duration: '4:33', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 206, name: '世界这么大还是遇见你', artist: '程响', duration: '4:21', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 207, name: '飞鸟和蝉', artist: '任然', duration: '4:05', picUrl: '/assets/default-cover.svg', url: '' }
  ],
  3: [ // 经典老歌
    { id: 301, name: '月亮代表我的心', artist: '邓丽君', duration: '3:37', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 302, name: '甜蜜蜜', artist: '邓丽君', duration: '3:19', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 303, name: '小城故事', artist: '邓丽君', duration: '3:45', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 304, name: '上海滩', artist: '叶丽仪', duration: '3:28', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 305, name: '千千阙歌', artist: '陈慧娴', duration: '4:12', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 306, name: '倩女幽魂', artist: '张国荣', duration: '4:18', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 307, name: '沧海一声笑', artist: '许冠杰', duration: '3:24', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 308, name: '海阔天空', artist: 'Beyond', duration: '5:24', picUrl: '/assets/default-cover.svg', url: '' }
  ],
  4: [ // 欧美流行
    { id: 401, name: 'Shape of You', artist: 'Ed Sheeran', duration: '3:53', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 402, name: 'Blinding Lights', artist: 'The Weeknd', duration: '3:20', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 403, name: 'Watermelon Sugar', artist: 'Harry Styles', duration: '2:54', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 404, name: 'Levitating', artist: 'Dua Lipa', duration: '3:23', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 405, name: 'Bad Habits', artist: 'Ed Sheeran', duration: '3:51', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 406, name: 'Stay', artist: 'The Kid LAROI & Justin Bieber', duration: '2:21', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 407, name: 'Good 4 U', artist: 'Olivia Rodrigo', duration: '2:58', picUrl: '/assets/default-cover.svg', url: '' }
  ],
  5: [ // K-POP精选
    { id: 501, name: 'Dynamite', artist: 'BTS', duration: '3:19', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 502, name: 'How You Like That', artist: 'BLACKPINK', duration: '3:01', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 503, name: 'Next Level', artist: 'aespa', duration: '3:30', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 504, name: 'WANNABE', artist: 'ITZY', duration: '3:13', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 505, name: 'Butter', artist: 'BTS', duration: '2:44', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 506, name: 'Lovesick Girls', artist: 'BLACKPINK', duration: '3:12', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 507, name: 'ELEVEN', artist: 'IVE', duration: '2:58', picUrl: '/assets/default-cover.svg', url: '' }
  ],
  6: [ // 影视原声
    { id: 601, name: '我的心永恒', artist: 'Celine Dion', duration: '4:40', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 602, name: '成都', artist: '赵雷', duration: '5:28', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 603, name: '后来', artist: '刘若英', duration: '4:20', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 604, name: '时间都去哪儿了', artist: '王铮亮', duration: '4:22', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 605, name: '演员', artist: '薛之谦', duration: '4:20', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 606, name: '小幸运', artist: '田馥甄', duration: '4:28', picUrl: '/assets/default-cover.svg', url: '' },
    { id: 607, name: '匆匆那年', artist: '王菲', duration: '3:57', picUrl: '/assets/default-cover.svg', url: '' }
  ]
}

// 获取歌单歌曲列表
function getPlaylistSongs(playlistId) {
  return PLAYLIST_SONGS[playlistId] || []
}

// 获取歌单信息
function getPlaylistInfo(playlistId) {
  const playlistNames = {
    1: '热门推荐',
    2: '新歌首发', 
    3: '经典老歌',
    4: '欧美流行',
    5: 'K-POP精选',
    6: '影视原声'
  }
  
  return {
    id: playlistId,
    name: playlistNames[playlistId] || '未知歌单',
    coverImgUrl: getPlaylistCover(playlistId)
  }
}

module.exports = {
  DEFAULT_IMAGES,
  getPlaylistCover,
  getBannerImage,
  getPlaylistSongs,
  getPlaylistInfo
}